import 'package:flutter/material.dart';

import 'package:get/get.dart';

import 'app/routes/app_pages.dart';

import 'package:flutter_screenutil/flutter_screenutil.dart'; // 屏幕适配
import 'package:flutter/services.dart'; // 导入系统服务包 可设置顶部状态栏颜色

void main() {
  // 配置透明的状态栏
  // SystemUiOverlayStyle systemUiOverlayStyle = const SystemUiOverlayStyle(
  //   statusBarColor: Colors.transparent,
  // );
  // SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);

  runApp(
    ScreenUtilInit(
      // 初始化屏幕适配
      designSize: const Size(1080, 2400), // 设计稿的像素尺寸---px
      builder: (context, child) => GetMaterialApp(
        // debugShowMaterialGrid: true, // 显示布局网格
        title: "Application",
        defaultTransition: Transition.rightToLeft, // 全局配置页面切换动画
        theme: ThemeData(
          scaffoldBackgroundColor: Color.fromARGB(
            250,
            250,
            250,
            250,
          ), // 页面全局背景色
          buttonTheme: const ButtonThemeData(
            buttonColor: Colors.orange,
            textTheme: ButtonTextTheme.primary, 
          ),
          checkboxTheme: CheckboxThemeData(
            fillColor: WidgetStateProperty.all(Colors.orange),
            shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
          ), // 全局配置按钮主题
          appBarTheme: const AppBarTheme(
            backgroundColor: Colors.white,
            centerTitle: true,
            scrolledUnderElevation: 0, // 全局配置滚动时appbar阴影为0
          ), // 全局appbar主题
          // colorScheme: const ColorScheme.light(primary: Colors.red, onPrimary: Colors.green),
        ),
        initialRoute: AppPages.INITIAL, // 初始路由
        getPages: AppPages.routes,
        debugShowCheckedModeBanner: false, // 去掉调试模式的banner
      ),
    ),
  );
}
